import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import top.aiprogram.controller.UserController;
import top.aiprogram.entity.User;
import top.aiprogram.service.UserService;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("top/aiprogram/resource/application-context.xml");
        UserController controller = context.getBean(UserController.class);
        UserService userService = controller.getUserService();
        User user = controller.getUser();
        userService.user("阿西吧",25);
        System.out.println("姓名为："+user.getName()+"--- 年龄为："+user.getAge());
    }
}
